#coding=utf-8
import RPi.GPIO as GPIO
import time
import serial

A = 0X3455
B = 0X1343
C = 0X4345

pyserial_test=serial.Serial("/dev/ttyS0",115200)
def main():
	while True:
		count=pyserial_test.inWaiting()
		if count!=0:
			# recv="pi return: "+pyserial_test.read(count)+"\n"
			recv = str(A) + str(B) + str(C)
			print recv
			pyserial_test.write(recv)
		pyserial_test.flushInput()
		time.sleep(0.1)
if __name__=='__main__':
	try:
		main()
	except KeyboardInterrupt:
		if pyserial_test!=None:
			pyserial_test.close()
